'''
Created on Sep 29, 2011

@author: lewis.gordon
'''
from PyQt4 import QtCore, QtGui
import sys, mainwindow

class Main(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui=mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)
        self.textField = self.ui.plainTextEdit
        self.setText("Lew:\n")
        QtCore.QObject.connect(self.ui.pushButton,QtCore.SIGNAL("clicked()"), self.addText)
        
    def setText(self,inputStr):
        self.textField.setPlainText(QtGui.QApplication.translate("MainWindow", inputStr, None, QtGui.QApplication.UnicodeUTF8))
    
    def addText(self):
        lineText = self.ui.lineEdit.text()
        if(lineText):
            self.textField.appendPlainText(QtGui.QApplication.translate("MainWindow", lineText+'\n', None, QtGui.QApplication.UnicodeUTF8))
        
def main():
    app = QtGui.QApplication(sys.argv)
    window=Main()
    window.show()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()
    